package ru.compft.common.data.acl;

import ru.compft.common.data.meta.acl.AclClassTableMeta;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 * User: VVasiliev
 * Date: 01.11.12
 * Time: 12:00
 * <p/>
 * Класс представляющий объект "Классы в ACL"
 * <p/>
 * <p/>
 * CREATE TABLE IF NOT EXISTS ACL_CLASS (
 * ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
 * CLASS VARCHAR(255) NOT NULL,
 * CONSTRAINT UNIQUE_UK_2 UNIQUE(CLASS)
 * )
 */
@Entity
@Table(name = AclClassTableMeta.TABLE_NAME)
public class AclClass implements Serializable {
    private static final long serialVersionUID = -8132372146649562345L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = AclClassTableMeta.ID, unique = true, nullable = false)
    private Long id;

    @Column(name = AclClassTableMeta.CLASS, unique = true, nullable = false, length = 255)
    private String aclClass;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAclClass() {
        return aclClass;
    }

    public void setAclClass(String aclClass) {
        this.aclClass = aclClass;
    }
}
